export default function login(request) {
  // 登录方法
  function login(username, password, code, uuid) {
    const data = {
      username,
      password,
      code,
      uuid,
    };
    return request({
      url: "/auth/login",
      headers: {
        isToken: false,
      },
      method: "post",
      data: data,
    });
  }

  // 注册方法
  function register(data) {
    return request({
      url: "/auth/register",
      headers: {
        isToken: false,
      },
      method: "post",
      data: data,
    });
  }

  // 获取用户详细信息
  function getInfo() {
    return request({
      url: "/system/user/getInfo",
      method: "get",
    });
  }
  return {
    login,
    register,
    getInfo
  };
}
